Skip to content

Honor to_io-only redirection wrappers - #202

Open
OskarEichler wants to merge 2 commits into
enkessler:masterfrom
OskarEichler:codex/to-io-redirection
Open

Honor to_io-only redirection wrappers#202
OskarEichler wants to merge 2 commits into
enkessler:masterfrom
OskarEichler:codex/to-io-redirection

Conversation

@OskarEichler

Copy link
Copy Markdown

Accepts output and error redirection wrappers that implement to_io without exposing fileno directly, matching Ruby IO coercion conventions.

Verified with 70 upstream examples plus focused redirection models.

@eregon

eregon commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Would need a test, and a real-world use case

@OskarEichler

Copy link
Copy Markdown
Author

Added an end-to-end regression using an IO adapter that deliberately exposes only Ruby’s to_io conversion protocol around a tempfile. This is the concrete use case: lifecycle/instrumentation wrappers can keep their public surface narrow while still being valid redirection targets (and ChildProcess::Unix::IO#check_type already explicitly accepts them). Before this change assignment succeeds but start raises on the missing direct fileno; now the child output reaches the wrapped IO. The focused IO spec passes (11 examples).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants